package com.activeMQ.student.broker;

import org.apache.activemq.broker.BrokerService;

/**
 * 内嵌MQ服务器
 * @date 2020/10/8 14:11
 */
public class EmbedBroker {

    public static void main(String[] args) {

        BrokerService brokerService = new BrokerService();

//        设置使用的消息协议
        brokerService.setUseJmx(true);

//        设置协议形式
        try {
            brokerService.addConnector("tcp://127.0.0.1:61616");
            brokerService.start();
        } catch (Exception e) {
            e.printStackTrace();
        }

        System.out.println("内嵌MQ成功");

    }
}
